package com.baselibrary.net.interceptor;

import java.io.IOException;

import okhttp3.Headers;
import okhttp3.Interceptor;
import okhttp3.Request;
import okhttp3.Response;

/**
 * @author zhanglijie
 * @date 20-3-14
 * @Description
 */
public class HeaderInterceptor implements Interceptor {
    @Override
    public Response intercept(Chain chain) throws IOException {
        Request request = chain.request();
        Request.Builder requestBuilders = request.newBuilder();

        Headers.Builder headerBuilder = request.headers().newBuilder();
//        String userToken = HKSPUtils.Companion.getInstance(SharedTableName.LOGIN_INFO).getString("login_token", "");
//        headerBuilder.add("X-Authorization", "Bearer " + userToken);
        requestBuilders.headers(headerBuilder.build());
        request = requestBuilders.build();
        return chain.proceed(request);
    }
}
